﻿using System.Collections.Generic;

namespace Ndns.Packet.Helpers
{
    internal static class HashCodeHelper
    {

        public static int GetHashCode<T>(List<T> list)
        {
            int total = 17;
            foreach (var item in list)
            {
                total = total * 37 + item.GetHashCode();
            }
            return total;
        }

        public static int GetHashCode<T>(IEnumerable<T> list)
        {
            int total = 17;
            foreach (var item in list)
            {
                total = total * 37 + item.GetHashCode();
            }
            return total;
        }
    }
}
